package org.example.ag_notes.repository;

import org.example.ag_notes.entity.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends CrudRepository<User, Integer> {
    //按名字查找
    Optional<User> findByUsername(String username);
    //查看用户名是否存在
    boolean existsByUsername(String username);

}
